package pers.twm.mybatis.util;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.ui.content.ContentFactory;

/**
 * @ClassName MyServiceConsoleAction
 * @Description TODO
 * @Author tianwanming
 * @Date 2023/3/19 14:40
 * @Version 1.0
 */
public class MyServiceConsoleAction extends AnAction {
    public void actionPerformed(AnActionEvent e) {
        // 创建 ConsoleView 和 ConsoleProperties
        MyServiceConsoleView consoleView = new MyServiceConsoleView();
//        MyServiceConsoleProperties consoleProperties = new MyServiceConsoleProperties();

        // 配置 ConsoleProperties
//        consoleProperties.setUsePredefinedMessageFilter(false);
//        consoleProperties.setActivateToolWindowWhenAdded(true);

        // 创建 ConsoleRunner
//        ConsoleRunner consoleRunner = new ConsoleRunner(consoleView, consoleProperties);
//
//        // 将 ConsoleView 添加到控制台窗口
//        ToolWindowManager.getInstance(e.getProject()).getToolWindow("Service").getContentManager().addContent(
//                ContentFactory.SERVICE.getInstance().createContent(consoleRunner.getComponent(), "My Service Console", true));
//
//        // 运行 ConsoleRunner
//        consoleRunner.run();
    }
}
